// src/api/modules/user.js
import request from '@/utils/request'

export const userAPI = {
  // 获取用户列表
  getList: (params) => request.get('/users', { params }),
  
  // 创建用户
  create: (data) => request.post('/users', data),
  
  // 更新用户
  update: (id, data) => request.put(`/users/${id}`, data),
  
  // 删除用户
  delete: (id) => request.delete(`/users/${id}`),
  
  // 获取用户详情
  getDetail: (id) => request.get(`/users/${id}`),
  
  // 批量删除用户
  batchDelete: (ids) => request.delete('/users/batch', { data: { ids } }),
  
  // 启用/禁用用户
  toggleStatus: (id, status) => request.patch(`/users/${id}/status`, { status }),
  
  // 重置用户密码
  resetPassword: (id) => request.post(`/users/${id}/reset-password`)
}